﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StyleMVVM.DependencyInjection
{
#if NETFX_CORE
	public sealed class UnknownExportArgs : object
#else
	public sealed class UnknownExportArgs : EventArgs
#endif
	{
		public UnknownExportArgs(string requestedName, Type requestedType, bool resolveMultiple)
		{
			RequestedName = requestedName;
			RequestedType = requestedType;
			ResolveMultiple = resolveMultiple;
		}

		public bool ResolveMultiple { get; private set; }

		public string RequestedName { get; private set; }

		public Type RequestedType { get; private set; }

		public void ProvideExportStrategies(params IExportStrategy[] strategies)
		{
			if (ExportStrategies != null)
			{
				List<IExportStrategy> allStrategies = new List<IExportStrategy>(ExportStrategies);

				allStrategies.AddRange(strategies);

				ExportStrategies = allStrategies;
			}
			else
			{
				ExportStrategies = strategies;
			}
		}

		public IEnumerable<IExportStrategy> ExportStrategies { get; private set; } 
	}
}
